package com.kyz.speechsdk.engine.entity;

import java.util.List;
import java.util.Random;

//本地语料库实体
public class ExcelData {

    List<String> keywords; //一个回答可对应多个关键词
    List<String> answers; // 一个关键词可对应多个回答
    String catalogue; //语料库名字
    int catalogueID; // 语料库ID,用作处理语料的顺序

    public ExcelData(List<String> keywords, List<String> answers, String catalogue, int catalogueID) {
        this.keywords = keywords;
        this.answers = answers;
        this.catalogue = catalogue;
        this.catalogueID = catalogueID;
    }

    public List<String> getKeywords() {
        return keywords;
    }

    public List<String> getAnswers() {
        return answers;
    }

    //获取随机回答
    public String getRandomAnswer() {
        if (answers.size() >= 1) {
            int index = new Random().nextInt(answers.size());
            return answers.get(index);
        }
        return null;
    }

    public String getCatalogue() {
        return catalogue;
    }

    public int getCatalogueID() {
        return catalogueID;
    }

    public void setKeywords(List<String> keywords) {
        this.keywords = keywords;
    }

    public void setAnswers(List<String> answers) {
        this.answers = answers;
    }

    public void setCatalogue(String catalogue) {
        this.catalogue = catalogue;
    }

    public void setCatalogueID(int catalogueID) {
        this.catalogueID = catalogueID;
    }

    @Override
    public String toString() {
        return "ExcelData{" +
                "keywords='" + keywords + '\'' +
                ", answers='" + answers + '\'' +
                ", catalogue='" + catalogue + '\'' +
                ", catalogueID=" + catalogueID +
                '}';
    }

}
